<?php
echo str_replace("中国", 'CN', "中国china-php程序，中国北京"), "\n";
echo str_replace("abc", 'CN', "中国china-php程序，中国北京"), "\n";
echo str_ireplace("php", "php8", "hello,PHP"), "\n";

//删除字符串中所有数字
echo preg_replace("/\d+/", "", "hello10000php8html5"), "\n";//hellophphtml

//删除字符串中所有字母
echo preg_replace("/[a-z]/i", "", "hello10000php8HTML5"), "\n"; //1000085

echo strlen('hello中国'), "\n";//字节个数
echo mb_strlen('hello中国'), "\n"; //字符个数，支持汉字

//统计字符出现的次数
echo substr_count("aaa中中中a23中sa", "状"), "\n";//0
echo substr_count("aaa中中中a23中sa", "中"), "\n";//4

$f1 = "d:/user/uploads/xvsfsf22424.jpg";
echo mb_substr($f1, mb_strrpos($f1, ".")), "\n";

$f2 = "d:\\user\\uploads\\xvsfsf22424.jpg";
